# -*- coding: utf-8 -*-

from django.db import models
import pyecharts.options as opts
from pyecharts.charts import Pie

# Create your models here.

class Resource(models.Model):
	name = models.CharField(verbose_name=u'参数', max_length=128, help_text=u'相关性能的参数')
	current_time = models.DateTimeField(verbose_name=u'时间', auto_now=True)

	type_choices = (
		(0, '输入'),
		(1, '输出'),
	)
	typeq = models.IntegerField(verbose_name='类型', choices=type_choices)
	list_display = ('id','name','current_time','typeq')
	list_per_page = 10

	class Meta:
		verbose_name = "资源"
		verbose_name_plural = "系统资源"

	def __str__(self):
		return self.name


class cpu_resource_get(models.Model):
	pass

class memory_resource_get(models.Model):
	pass

class channel_count(models.Model):
	pass


class ViewsByDay(models.Model):
    date = models.DateTimeField(verbose_name=u'时间', auto_now=True)
    cpu_count = models.IntegerField(verbose_name='CPU性能参数')
    gpu_count = models.IntegerField(verbose_name='GPU性能参数')
    mem_count = models.IntegerField(verbose_name='内存性能参数')
    


class ViewsByDayModel(ViewsByDay):
    class Meta:
        proxy = True # 使用代理
        verbose_name = u'性能参数'
        verbose_name_plural = verbose_name





'''
1. 通道使用数量  /总通道数 
2. 实时流/本地流 /其它录像占用通道比例 
3. CPU 使用率 /GPU使用率 
4. 内存使用率 

'''